package gwtappcontainer.server.apis.security;

import gwtappcontainer.shared.apis.security.RoleProp;

import java.util.TreeSet;

import com.googlecode.objectify.annotation.Cache;
import com.googlecode.objectify.annotation.Entity;
import com.googlecode.objectify.annotation.Id;
import com.googlecode.objectify.annotation.Index;

@Entity @Cache
class RoleEntity {
	@Id Long id;
	@Index String role;
	
	TreeSet<String> privileges = new TreeSet<String>();
	
	RoleProp toProp() {
		RoleProp prop = new RoleProp();		
		prop.role = role;
		prop.privileges = privileges;		
				
		return prop;
	}
}